package com.boruan.qq.zxgylibrary.service.manager;

import com.boruan.qq.zxgylibrary.service.model.AddressBackPriceBean;
import com.boruan.qq.zxgylibrary.service.model.AddressListBean;
import com.boruan.qq.zxgylibrary.service.model.DownOrderBean;
import com.boruan.qq.zxgylibrary.service.model.FirstBannerBean;
import com.boruan.qq.zxgylibrary.service.model.FirstCategoryBean;
import com.boruan.qq.zxgylibrary.service.model.PayResultBean;
import com.boruan.qq.zxgylibrary.service.model.SettleDefaultAddressBean;
import com.boruan.qq.zxgylibrary.service.model.ShopCarDataBean;

import java.util.Map;

import io.reactivex.Observable;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.PartMap;
import retrofit2.http.Query;


/**
 * Created by 崔琦 on 2019/9/2.
 * des: 网络请求接口 （请求头动态添加）
 */

public interface RetrofitService {

    /** 获取首页轮播图 */
    @GET("drugstore/api/index/bannerList")
    Observable<FirstBannerBean> getFirstBanner(@Header("authorization") String uId,@Query("bundleId") String bundleId,@Query("appVersion") String appVersion,@Query("sourceSystem") String sourceSystem);
    /** 获取首页分类 */
    @GET("drugstore/api/index/categoryList")
    Observable<FirstCategoryBean> getFirstCategory(@Header("authorization") String uId,@Query("bundleId") String bundleId,@Query("appVersion") String appVersion,@Query("sourceSystem") String sourceSystem);
    /** 上传经纬度 */
    @GET("drugstore/api/user/savelocation")
    Observable<ResponseBody> saveUpdateLocation(@Header("authorization") String uId, @Query("latitude") String latitude,@Query("longitude") String longitude,@Query("bundleId") String bundleId,@Query("appVersion") String appVersion,@Query("sourceSystem") String sourceSystem);
    /** 保存用户地址 */
    @POST("drugstore/api/address/add")
    Observable<ResponseBody> addAddress(@Header("authorization") String uId, @Body RequestBody body);
    /** 获取地址列表 */
    @GET("drugstore/api/address/list")
    Observable<AddressListBean> getAddressData(@Header("authorization") String uId,@Query("shopId") String shopId,@Query("bundleId") String bundleId,@Query("appVersion") String appVersion,@Query("sourceSystem") String sourceSystem);
    /** 删除地址 */
    @GET("drugstore/api/address/del")
    Observable<ResponseBody> deleteAddress(@Header("authorization") String uId,@Query("addressId") int id,@Query("bundleId") String bundleId,@Query("appVersion") String appVersion,@Query("sourceSystem") String sourceSystem);
    /** 修改地址 */
    @POST("drugstore/api/address/modify")
    Observable<ResponseBody> modifyAddress(@Header("authorization") String uId, @Body RequestBody body);
    /** 修改默认地址 */
    @GET("drugstore/api/address/modifyDefault")
    Observable<ResponseBody> modifyDefaultAddress(@Header("authorization") String uId, @Query("addressId") int addressId,@Query("bundleId") String bundleId,@Query("appVersion") String appVersion,@Query("sourceSystem") String sourceSystem);
    /** 获取用户在购物车选择的药品 */
    @GET("drugstore/api/drugsCart/shopCartInfo")
    Observable<ShopCarDataBean> getShopCarData(@Header("authorization") String uId, @Query("shopId") String shopId,@Query("bundleId") String bundleId,@Query("appVersion") String appVersion,@Query("sourceSystem") String sourceSystem);
    /** 获取结算页默认收货地址 */
    @GET("drugstore/api/address/settle/default")
    Observable<SettleDefaultAddressBean> getSettleDefaultAddress(@Header("authorization") String uId, @Query("shopId") String shopId,@Query("bundleId") String bundleId,@Query("appVersion") String appVersion,@Query("sourceSystem") String sourceSystem);
    /** 判断当前地址是否支持配送,并返回配送价格和距离 */
    @GET("drugstore/api/address/canDelivery")
    Observable<AddressBackPriceBean> judgeDelivery(@Header("authorization") String uId,@Query("addressId") int id,@Query("shopId") String shopId,@Query("bundleId") String bundleId,@Query("appVersion") String appVersion,@Query("sourceSystem") String sourceSystem);
    /** 下单接口 */
    @POST("drugstore/api/order/add")
    Observable<DownOrderBean> userDownOrder(@Header("authorization") String uId, @Body RequestBody body);
    /** 支付通知接口 */
    @Multipart
    @POST("drugstore/api/drugstore/notify")
    Observable<ResponseBody> payNotice(@Header("authorization") String uId, @PartMap Map<String, RequestBody> requestBodyMap);
    /** 订单详情接口，只为了取订单状态值 */
    @GET("drugstore/api/order/orderInfo")
    Observable<ResponseBody> getOrderDetailInfo(@Header("authorization") String uId,@Query("orderId") String orderId,@Query("bundleId") String bundleId,@Query("appVersion") String appVersion,@Query("sourceSystem") String sourceSystem);

    /** 国信中台支付接口 */
    @POST("v2/ucfpay/ucfpay/trade/shyTrade")
    Observable<ResponseBody> getPayParam(@Header("authorization") String uId, @Body Map<String, Object> requestBodyMap);
    /** 获取支付信息接口 */
    @POST("v2/tradeCenter/trade/show")
    Observable<PayResultBean> getPayResultInfo(@Header("authorization") String uId,@Body RequestBody body);

}
